<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
    
</body>

        <script>
            var sum = 1;

            function doNum(num)
            {
                if(num<=1)
                {
                    document.write(sum);
                }
                else
                {
                    sum *= num;

                    num--;

                    doNum(num);
                }
            }

            doNum(10);

        </script>
</html>